<?php
/**
 * Created by PhpStorm.
 * User: xiangfeng
 * Date: 2020/6/27
 * Time: 9:34 PM
 */

namespace app\api\http\exceptions;


class ApiErr
{
    /*************************** 通用Api Exception code 0~99 ***************************/
    const SUCCESS = [0, 'success'];
    const API_REQUEST_ERROR = [1, '请求异常'];
    const API_DB_ERROR = [2, 'DB异常'];
    const ERROR_PARAMS = [3, '参数缺失'];
    const API_UNKNOWN_ERROR = [10, '接口异常'];
    const ERROR_TOKEN = [7, 'token不存在或已过期'];//
    const INVALID_TOKEN = [7, '无效Token'];//
    const GET_USER_INFORMATION_FAILED = [17, '尚未授权绑定手机号'];
    const ILLEGAL_USER_WARRING = [39, '非法用户请求'];
    const PLEASE_CONFIRM_UPLOAD_FILE = [37, '请确认是否上传文件'];

    /*************************** Db operation Exception  code 100~999 ***************************/
    const UPDATE_DB_FAILED = [100, '修改失败'];
    const SELECT_DB_FAILED = [101, '未查询到相关信息'];
    const INSERT_DB_FAILED = [102, '添加失败'];
    const DELETE_DB_FAILED = [103, '删除失败'];

    /*************************** User Api Exception code 1000~1999 ***************************/
    const USER_INFO_NO_EXIST = [1001, '用户信息不存在'];
    const USER_LOGIN_ERROR = [1001, '帐号不存在或密码错误'];
    const USER_PHONE_ALREADY_EXISTS = [1003, '手机号已存在'];
    const USER_MOBILE_CHECK = [1005, '手机号码已绑定其它账号'];
    const USER_ACC_NO_CERT = [1006, '帐号未认证，请等待认证通过！'];//cert

    const USER_AUTH_LOGIN_ERROR = [1006, '授权登录异常'];
    const USER_AUTH_REG_ERROR = [1007, '授权注册异常'];
    const USER_AUTH_PHONE_FAILED = [1009, '手机号获取失败'];
    const USER_ALREADY_JOIN_FRIEND = [1020, '该用户已经是您的好友了'];
    const USER_FRIEND_NO_EXIST = [1021, '好友信息不存在'];
    const USER_FRIEND_FOLLOW_NO_EXIST = [1022, '好友申请记录不存在'];
    const USER_ABNORMAL_ACCOUNT = [1046, '用户账号异常'];
    /*************************** Article Api Exception code 2000~2999 ***************************/
    const ARTICLE_INFO_NO_EXIST = [2001, '未找查询到相关文章信息'];
}

